SUFFIXES=.ecpp .png .jpg .css .js
#ECPPC=/home/mdragan/Applications/tntnet/bin/ecppc
ECPPC=ecppc
#CXXFLAGS+=`../tntnet-config --cxxflags` -fPIC -O2
CXXFLAGS+=`tntnet-config --cxxflags` -fPIC -O2 -I./c++/util
#LDFLAGS+=-shared `../tntnet-config --libs`
LDFLAGS+=-shared `tntnet-config --libs` -ltntdb
OBJS=$(shell find . -name "*.ecpp" | sed -e 's/ecpp/o/g'; find beans -name "*.cpp" | sed -e 's/cpp/o/g'; find imgs -name "*.png" | sed -e 's/png/o/g'; find scripts -name "*.js" | sed -e 's/js/o/g'; find style -name "*.css" | sed -e 's/css/o/g')

../dono.so: $(OBJS)
	$(CXX) -o $@ $(LDFLAGS) $^
%.cpp: %.ecpp
	$(ECPPC) $(ECPPFLAGS) $(ECPPFLAGS_CPP) $<
%.cpp: %.png
	$(ECPPC) $(ECPPFLAGS) $(ECPPFLAGS_PNG) -b $<
%.cpp: %.jpg
	$(ECPPC) $(ECPPFLAGS) $(ECPPFLAGS_JPG) -b $<
%.cpp: %.css
	$(ECPPC) $(ECPPFLAGS) $(ECPPFLAGS_CSS) -b $<
%.cpp: %.js
	$(ECPPC) $(ECPPFLAGS) $(ECPPFLAGS_JS) -b $<

clean:
	rm ../*.so
	rm *.o
	rm imgs/*.o
	rm beans/*.o
	rm scripts/*.o

test:
	echo $(OBJS)
